import { getMenus, getmenusbuild } from '@/api/system';
import { PaginationQuery, TableData } from '@/types/table';
import { DeptsQuery } from '@/types/depts';

export default async function useMenus(params: PaginationQuery | DeptsQuery): Promise<TableData> {
    const { content, totalElements } = await getMenus(params);

    return {
        list: content,
        total: totalElements,
    };
}

export async function useMenusbuild(query: { needId: boolean }) {
    const content = await getmenusbuild(query);
    return {
        list: content,
    };
}
